# Contributor: Tim <timstanleydev@gmail.com>
# Maintainer: Tim <timstanleydev@gmail.com>
pkgname=ebusd
pkgver=22.3
pkgrel=0
pkgdesc="Daemon for communication with eBUS heating systems"
url="https://github.com/john30/ebusd"
# Upstream only supports these archs.
arch="x86 x86_64 aarch64 armhf armv7"
license="GPL-3.0-only"
makedepends="argp-standalone cmake mosquitto-dev openssl-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/john30/ebusd/archive/refs/tags/v$pkgver.tar.gz
	cmake.patch
	"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	ctest --output-on-failure --test-dir build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
565a2a95841680825a29a67dfed2277188951574b3bee7ac75667e264163288d7ebda03112ca5dbeafa96f44e22480203dcde50a46b8cc82597e385e4fa134c2  ebusd-22.3.tar.gz
9eb3930e924593e2f20eb678c7d3bf5cfbcac5a61ed413f55174cebdcbdb037344483d9ddffcb1a63b11b685028b7ce7012b4b8b7af3086e2818e6f635820cea  cmake.patch
"
